import request from '../request'
// 获取购物车列表
export function cart (data) {
  return request({
    url: 'cart/cartList',
    method: 'GET',
    data
  })
}

// 添加到购物车
export function addCart (data) {
  return request({
    url: 'cart/addCart',
    method: 'POST',
    data
  }, false)
}

// 提交订单
export function submitAction (data) {
  return request({
    url: 'order/submitAction',
    method: 'POST',
    data
  })
}

// 获取确认订单
export function cartdetailAction (data) {
  return request({
    url: 'order/detailAction',
    method: 'GET',
    data
  })
}

// 获取地址列表
export function getListAction (data) {
  return request({
    url: 'address/getListAction',
    method: 'GET',
    data
  })
}

// 保存或新建地址
export function saveAction (data) {
  return request({
    url: 'address/saveAction',
    method: 'POST',
    data
  })
}

// 删除购物车商品
export function cartDelete (data) {
  return request({
    url: 'cart/deleteAction',
    method: 'GET',
    data
  })
}

// 删除地址
export function addressDel (data) {
  return request({
    url: 'address/deleteAction',
    method: 'GET',
    data
  })
}
